﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Text;
using RipPoll.Business;
using RipPoll.Library;
using RipPoll.Services.Contracts;

namespace RipPoll.Services.Library
{
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class PollServices : IPollServices
    {

        public string[] GetZipCodesForPollid(int PollId)
        {

            PollBO pbo = new PollBO();
            return pbo.GetPollZipCodes(PollId);
        }


        public void AddPollCategory(RipPoll.Library.PollCategoryPE pc)
        {
            PollBO pbo = new PollBO();
            pbo.AddPollCategory(pc);
            pbo = null;
        }

        public void AddPoll(RipPoll.Library.PollPE pollPE, RipPoll.Library.UserPE upe)
        {
            PollBO pbo = new PollBO();
            pbo.AddPoll(pollPE, upe);
            pbo = null;
        }

        public List<RipPoll.Library.PollCategoryPE> GetPollcategories()
        {
            PollBO pbo = new PollBO();
            return pbo.GetPollcategories();
        }

        public List<RipPoll.Library.PollPE> GetUnApprovedPolls()
        {
            
            PollBO pbo = new PollBO();
            return pbo.GetUnApprovedPolls();
        }

        public void ApprovePoll(int id)
        {   
            PollBO pbo = new PollBO();
            pbo.ApprovePoll(id);
            pbo = null;
        }

        public List<PollPE> GetUserPolls(int userId)
        {
            PollBO pbo = new PollBO();
            return pbo.GetUserPolls(userId);            
        }

        
    }
}
